money = input("请输入你想转换的货币数加类型:")
ER = input("请输入美元/人民币的汇率:")
def one(money):
    if money[-1:] == "$":
        result = eval(money[:-1]) * eval(ER)
        print("{}$为{}￥".format(eval(money[:-1]), result))
    elif money[-1:] == "￥":
        result = eval(money[:-1]) / eval(ER)
        print("{}￥为{}$".format(eval(money[:-1]), result))
    else:
        print("您的输入有误1，请重新输入")


def three(money):
    if money[-3:] == "USD":
        result = eval(money[:-1]) * eval(ER)
        print("{}USD为{}RMB".format(eval(money[:-3]), result))
    elif money[-3:] == "RMB":
        result = eval(money[:-1]) / eval(ER)
        print("{}RMB为{}USD".format(eval(money[:-3]), result))
    else:
        print("您的输入有误2，请重新输入")


if money[-1:] == "$" or money[-1:] == "￥":
    one(money)
elif money[-3:] == "RMB" or money[-3:] == "USD":
    three(money)
else:
    print("您的输入有误3，请重新输入")
